package ywq;

public   enum Shape {
//   String[] Shape = {"直线", "曲线", "圆", "喷枪", "橡皮擦", "矩形", "椭圆", "圆角矩形", "弧线"};
    LINE("直线"),
    CURVE("曲线"),
    CIRCLE("圆"),
    PEN("喷枪"),
    ERASER("橡皮擦"),
    RECTANGLE("矩形"),
    ELLIPSE("椭圆"),
    ROUNDRECTANGLE("圆角矩形");
    private String name;
    private Shape(String name) {
        this.name = name;
    }

    public static Shape getByValue(String shape) {
        // 通过名称获取shape
        for (Shape s : Shape.values()) {
            if (s.name.equals(shape)) {
                return s;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

}
